package com.cart.pojo;

import java.io.Serializable;

public class Product implements Serializable {
    private static final long serialVersionUID = 1L; // 用于版本控制
    private int id;
    private String name;
    private String manufacturer;
    private String model;
    private String productionDate;
    private double purchasePrice;
    private double retailPrice;
    private int quantity;

    public Product(int id, String name, String manufacturer, String model, String productionDate, double purchasePrice, double retailPrice, int quantity) {
        this.id = id;
        this.name = name;
        this.manufacturer = manufacturer;
        this.model = model;
        this.productionDate = productionDate;
        this.purchasePrice = purchasePrice;
        this.retailPrice = retailPrice;
        this.quantity = quantity;
    }

    // getters and setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public String getManufacturer() { return manufacturer; }
    public void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; }

    public String getModel() { return model; }
    public void setModel(String model) { this.model = model; }

    public String getProductionDate() { return productionDate; }
    public void setProductionDate(String productionDate) { this.productionDate = productionDate; }

    public double getPurchasePrice() { return purchasePrice; }
    public void setPurchasePrice(double purchasePrice) { this.purchasePrice = purchasePrice; }

    public double getRetailPrice() { return retailPrice; }
    public void setRetailPrice(double retailPrice) { this.retailPrice = retailPrice; }

    public int getQuantity() { return quantity; }
    public void setQuantity(int quantity) { this.quantity = quantity; }

    @Override
    public String toString() {
        return "商品信息: " +
                "编号 = " + id +
                ", 名称 = '" + name + '\'' +
                ", 生产厂家 = '" + manufacturer + '\'' +
                ", 型号 = '" + model + '\'' +
                ", 生产日期 = '" + productionDate + '\'' +
                ", 进货价 = " + purchasePrice +
                ", 零售价 = " + retailPrice +
                ", 库存数量 = " + quantity;
    }
}
